﻿using HDSmartCommunity.DAL;
using HDSmartCommunity.Models;
using System.Collections.Generic;
using System;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace HDSmartCommunity.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class OwnerController : ControllerBase
    {

        public OwnerController()
        {
        }
        [HttpPost]
        [Route("QueryOwner")]
        public ResponseMessage QueryOwner()
        {
            ResponseMessage message = new ResponseMessage();
            CardInfoDAL da = new CardInfoDAL();
            try
            {
                List<OwnerInfo> list = da.QueryOwner();
                message.errcode = 0;
                message.data = list;
                message.total = list.Count;
            }
            catch (Exception ex)
            {
                message.errcode = 1;
                message.errmsg = "获取用户异常";
            }
            return message;
        }
    }
}
